package meterMonitor.util.excel;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.property.ExcelContentProperty;

public class SettlementConverter implements Converter<Integer> {
    @Override
    public Class supportJavaTypeKey() {
        return null;
    }

    @Override
    public CellDataTypeEnum supportExcelTypeKey() {
        return null;
    }

    @Override
    public Integer convertToJavaData(CellData cellData, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception {
        return null;
    }

    @Override
    public CellData convertToExcelData(Integer integer, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception {
        if (integer == 0) {
            return new CellData("安全异常");
        }
        if (integer == 1) {
            return new CellData("参数异常");
        }
        if (integer == 2) {
            return new CellData("传感异常");
        }
        if (integer == 3) {
            return new CellData("电气异常");
        }
        if (integer == 4) {
            return new CellData("卡板异常");
        }
        if (integer == 5) {
            return new CellData("开停异常");
        }
        if (integer == 6) {
            return new CellData("门盖异常");
        }
        if (integer == 7) {
            return new CellData("系统异常");
        }
        if (integer == 8) {
            return new CellData("液位异常");
        } else {
            return new CellData("未定义异常类型");
        }
    }
}
